		<!-- 水产苗种产地检疫采样送检通知单 -->
<template>
	<view style="width: 100%;">
		<uni-list>
			<uni-list-item :show-arrow="false" title="编号" :note="datas.snCode" />
			<uni-list-item :show-arrow="false" title="货主" :note="datas.snShipper" />
			<uni-list-item :show-arrow="false" title="申报单编号" :note="datas.decCode" />
			<uni-list-item :show-arrow="false" title="送检原因" :note="datas.reasonsIns" />
			<uni-list-item :show-arrow="false" title="检疫对象" :note="datas.diseaseName" />
			<uni-list-item :show-arrow="false" title="要求时间" :note="datas.snData|dateFormat" />
			<uni-list-item :show-arrow="false" title="水生动物疫控中心" :note="datas.snMechanism" />
			<uni-list-item :show-arrow="false" title="水生动物卫生监督所" :note="datas.authority" />
			<uni-list-item :show-arrow="false" title="签发日期" :note="datas.snTime|dateFormat" />
		</uni-list>
	</view>
</template>

<script>
import uniSection from '@/components/uni-section/uni-section.vue';
import uniList from '@/components/uni-list/uni-list.vue';
import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
import loginjs from '@/login.js'
import {
		mapState
	} from 'vuex'
export default {
	computed: mapState(['baseUrl']),
	components: {
		uniSection,
		uniList,
		uniListItem
	},
	data() {
		return {
			datas: {
			},
			Authorization:null,
			reasonsInsList:[]
		};
	},
	methods: {
		onLoad(option) {
			this.Authorization = loginjs.getAuthorization();
			this.getList(option.id)
		},
		getList(id) {
			uni.request({
				method: "GET",
				url: this.baseUrl + 'api/quarantine/samplNotice/' + id,
				header: {
					"Authorization": this.Authorization,
				},
				success: (res) => {
					this.datas = res.data.data
					this.getInspectWhyList()
					var diseaseNmeTemp=JSON.parse(this.datas.diseaseName)
					this.datas.diseaseName=''
					diseaseNmeTemp.forEach((data,i)=>{
						if(i!=diseaseNmeTemp.length-1){
							this.datas.diseaseName+=data+"/"
						}else{
							this.datas.diseaseName+=data
						}
						
					})
				}
			})
		},
		getInspectWhyList() {
			uni.request({
				method: "GET",
				url: this.baseUrl + 'api/system/sysDictionary/model/inspectWhy',
				header: {
					"Authorization": this.Authorization,
				},
				success: (res) => {
					this.reasonsInsList=res.data.data
					var reasonsInsTemp=JSON.parse(this.datas.reasonsIns)
					this.datas.reasonsIns=''
					this.reasonsInsList.forEach(data=>{
						reasonsInsTemp.forEach(item=>{
							if(data.dicValue==item){
								this.datas.reasonsIns+=data.dicName+'；'
							}
						})
					})
					console.log(this.reasonsInsList)
				}
			})
		}
	}
};
</script>

<style>

</style>
